<template>
  <div class="baseInfo">
    <div class="title">
      {{ goods.title }}
    </div>
    <div class="price">
      <span class="newPrice">{{ goods.newPrice }}</span>
      <span class="oldPrice">{{ goods.oldPrice }}</span>
      <span
        class="discount"
        :style="{ backgroundColor: goods.discountBgColor }"
        >{{ goods.discount }}</span
      >
    </div>
    <div class="other">
      <span v-for="(item, index) in goods.columns" :key="index">{{
        item
      }}</span>
    </div>
    <div class="service">
      <div v-for="(item, index) in goods.services" :key="index">
        <img :src="item.icon" alt="" />
        <span>{{ item.name }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "detailBaseInfo",
  props: {
    goods: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>

<style scoped>
.title {
  padding: 12px 7px;
  font-size: 14px;
  font-weight: 500;
  text-indent: 1em;
}
.price {
  padding: 0 6px;
  height: 26px;
  position: relative;
}
.newPrice {
  font-size: 26px;
  color: var(--color-tint);
}
.oldPrice {
  text-decoration: line-through;
  font-size: 13px;
  color: #999;
  margin: 0 5px;
}
.discount {
  display: inline-block;
  position: absolute;
  padding: 0 5px;
  border-radius: 7px;
  color: white;
  top: 3px;
  margin-left: 5px;
  line-height: 19px;
}
.other {
  color: #939597;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 7px 5px 7px;
}
.service {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 14px;
  padding: 10px 5px;
  border-bottom: 1px solid #f1f0f0;
  border-top: 1px solid #f1f0f0;
}
.service div {
  height: 100%;
}
.service img {
  height: 100%;
  vertical-align: middle;
}
.service span {
  padding-left: 3px;
  font-size: 11px;
}
</style>
